**************************
*** Covid-19 & Fox News 
*** Raw data
*** April 2020 
**************************

clear all
set mem 600m
set matsize 800	
set more off
set logtype text
set scheme s1color      
clear

use "/Users/shirraviv/Dropbox/Rawdata8.8.dta"

*********************************
***  Q28   Screeners colors   ***
*********************************
gen failed_screener = Q28 != "3,5" 
replace failed_screener = Q28 != "3,5" if Q28 != ""   

*******************************
***   Duration (in minutes) ***
*******************************
gen minutes = (Durationinseconds / 60)
label var minutes "duration in minutes"   
sum minutes, det
*Speeders
gen tooshort = minutes < 3.5

***************************************
* Pass Screeners - tooshort | screener
***************************************
gen pass_screeners = .
replace pass_screeners=1 if tooshort!= 1 | failed_screener!=1
replace pass_screeners=0 if tooshort== 1 | failed_screener==1

**************
*** Q3 age ***
**************
gen age = Q3 
label define agelab  1 "18-24" 2 "25-35" 3 "35-44" 4 "45-54" 5 "55-64" 6 "65 or older"
label values age agelab
 
*****************
*** Q2 Gender ***
*****************
gen female = Q2
replace female = 1 if Q2 == 2
replace female = 0 if Q2 != 2
label var female "Female"
label define femalelab 0 "Male" 1 "Female"  
label values female femalelab

***************
*** Q5 Race ***
***************
gen race = Q5
replace race = 1 if Q5 == 6
replace race = 2 if Q5 == 3  
replace race = 3 if Q5 == 2
replace race = 4 if Q5 == 1
replace race = 5 if Q5 == 4 | Q5 == 5 | Q5 == 7
label var race "Race"
label define raclab 1 "White" 2 "Hispanic" 3 "Black" 4 "Asian" 5 "Other" 
label values race raclab

********************
*** Q4 Education ***
********************
gen education = Q4
label var education "Education"
label define educlab 1 "Less than high school" 2 "High school" 3 "Some college" 4 "Associate’s degree" 5 "BA" 6 "Graduate degree" 
label values education educlab

******************
*** Q58 Income ***
******************
gen income = Q58
label var income "income"
label define incomelab 1 "less than $15,000" 2 "$15,000-$24,999" 3 "$25,000-$34,999" 4 "$35,000 to $49,999" 5 "$50,000-$74,999" 6 "$75,000-$99,999" 7 "$100,000-$124,999" 8 "$125,000-$149,999" 9 "$150,000 and above"
label values income incomelab

****************************************************************
***------------------- POLITICAL ATTITUDE -------------------***
****************************************************************

********************
*** Q55 Party ID ***
********************

** 3 Categories
gen PID3 = .
replace PID3 = 1 if Q55 == 1 | Q55 == 2
replace PID3 = 2 if Q55 == 3
replace PID3 = 3 if Q55 == 4 | Q55 == 5
label var PID3 "Party Affiliation 3 cat"
label define PID3lab  1 "Repulbic" 2 "Independent" 3 "Democrat" 
label values PID3 PID3lab

********************************************
*** Q56   Conservative - Liberal view    ***
********************************************
* 3 levels 
gen libcons3=.
replace libcons3=1 if Q56<5
replace libcons3=2 if Q56>4 & Q56<7
replace libcons3=3 if Q56>6 & Q56<11
label var libcons3 "political view"
label define libcons3lab 1 "liberal" 2 "mid" 3 "conservative"
label values libcons3 libcons3lab


**********************************************************************
***---------------------- FOX NEWS QUESTIONS ----------------------***
**********************************************************************

* SOURCE OF NEWS CONSUMPTION Q14_1-7 
gen newspapers=Q14_1 
gen radio=Q14_2
gen localtv=Q14_3
gen nationaltv=Q14_4
gen cabletv=Q14_5
foreach var in cabletv nationaltv localtv radio newspapers {
label define `var'_lab 1 "Daily" 2 "Weekly" 3 "Monthly" 4 "Less than montly" 
label values `var' `var'_lab
}

gen follownews =.
replace follownews = 1 if (Q14_1<3 & Q14_1 != .) | (Q14_2<3 & Q14_2 != .) | (Q14_3<3 & Q14_3 != .) | (Q14_4<3 & Q14_4 != .) | (Q14_5<3 & Q14_5 != .) | (Q14_6<3 & Q14_6 != .) | (Q14_7<3 & Q14_7 != .)
replace follownews = 0 if (Q14_1>2 & Q14_1 != .) | (Q14_2>2 & Q14_2 != .) | (Q14_3>2 & Q14_3 != .) | (Q14_4>2 & Q14_4 != .) | (Q14_5>2 & Q14_5 != .) | (Q14_6>2 & Q14_6 != .) | (Q14_7>2 & Q14_7 != .)
tab follownews, nol

tab cabletv if pass_screeners==1
tab cabletv if pass_screeners==1
tab cabletv if pass_screeners==1
gen cabletvdum = .
replace cabletvdum =1 if cabletv<3 & cabletv != .
replace cabletvdum =0 if cabletv>2 & cabletv != .
tab cabletvdum if pass_screeners==1


* NEWS CHANNELS Q30_1-3 
gen foxnews = Q30_1
label define watchfrequency 1 "Daily" 2 "Weekly" 3 "Monthly" 4 "Less than monthly" 
label values foxnews watchfrequency
tab foxnews if pass_screeners==1

gen cnn = Q30_2
label values cnn watchfrequency
tab cnn if pass_screeners==1

gen msnbc = Q30_3
label values msnbc watchfrequency
tab msnbc if pass_screeners==1


*NEWS PROGRAMS Q31_1-3
gen Hannity=Q31_1
gen Tucker=Q31_3
gen FoxFriends=Q31_4


foreach var in Hannity FoxFriends Tucker {
label define `var'_lab 1 "Daily" 2 "Weekly" 3 "Monthly" 4 "Less than montly" 
label values `var' `var'_lab
}

foreach var in Hannity FoxFriends Tucker  {
tab `var' if pass_screeners==1
}

*dummy 
foreach var in Hannity FoxFriends foxnews msnbc cnn Tucker {
gen `var'_watch=.
replace `var'_watch=1 if `var'<3
replace `var'_watch=0 if `var'>2 & `var'<5
label define `var'_watchlab 1 "Daily/Weekly" 0 "Monthly/less"
label values `var'_watch `var'_watchlab
}


*********************************************************************
***---------------- COVID-19 RETROSPECTICE QUESTIONS -------------***
*********************************************************************

***********************************************
***  changing behavior matrix Q19_1 _2 _3   ***
***********************************************
/*The last time you did any of the following activities: 
Q19_1 Eaten in a restaurant Q19_2 Visited a close friend Q19_3 Same room with more than 5 people */

gen restaurant_matrix = Q19_1
label var restaurant_matrix "Eaten in a restaurant"
gen friendhome_matrix = Q19_2
label var friendhome_matrix "Visited a close friend"
gen sameroom_matrix = Q19_3
label var sameroom_matrix "Same room with more than 5 people"

foreach var in sameroom_matrix friendhome_matrix restaurant_matrix {
label define `var'lab 1 "This week" 2 "A week ago" 3 "Two weeks ago" 4 "Three weeks ago or more"
label values `var' `var'lab 
} 

*MatrixQ mean of the three statements 
egen matrixbhv_mean = rowmean (restaurant_matrix friendhome_matrix sameroom_matrix)
label var matrixbhv_mean "changed bhv matrixQ mean"
sum matrixbhv_mean if pass_screeners==1
sum matrixbhv_mean if pass_screeners==1, detail

gen matrixbhv_meancat =.
replace matrixbhv_meancat=1 if matrixbhv_mean<2 & matrixbhv_mean!=.
replace matrixbhv_meancat=2 if matrixbhv_mean>=2 & matrixbhv_mean<3
replace matrixbhv_meancat=3 if matrixbhv_mean>=3 & matrixbhv_mean<4
replace matrixbhv_meancat=4 if matrixbhv_mean==4 

*MatrixQ dummy - this week or a week ago mean
gen matrixbhv_meandum = .
label var matrixbhv_meandum "matrixQ mean this week or week ogo"
replace matrixbhv_meandum = 1 if matrixbhv_meancat<3 & matrixbhv_meancat!=.
replace matrixbhv_meandum = 0 if matrixbhv_meancat>2 & matrixbhv_meancat<5
label define matrixbhv_meandumlab 1 "this week or week ago" 0 "more than a week ago" 
label values matrixbhv_meandum matrixbhv_meandumlab
tab matrixbhv_meandum if pass_screeners==1


**********************************************************************
***-------------------- COVID19 KNOWKEDGE QUESTIONS ---------------***
**********************************************************************

*VACCINE OR TREATMENT Q25 -- Hydroxychloroquine treatment
gen Hydroxychloroquine=.
label var Hydroxychloroquine "Hydroxychloroquine treatments"
replace Hydroxychloroquine=1 if Q25==5
replace Hydroxychloroquine=0 if Q25<5 & Q25!=.
label define Hydroxychloroquinelab 1 "Hydroxychloroquine" 0 "otherwise" 
label values Hydroxychloroquine Hydroxychloroquinelab


*******************************************************************
***-------------------- COVID19 POLICY QUESTIONS ---------------***
*******************************************************************

*TRADEOFF HEALTH VS ECONOMIC Q27 - 
gen ecohealth_tradeoff = Q27
sum ecohealth_tradeoff, detail
sum ecohealth_tradeoff

gen ecohealth_tradeoff2 = .
label var ecohealth_tradeoff2 "public health vs health economy 3 categories"
replace ecohealth_tradeoff2 = 1 if Q27>0 & Q27!=.
replace ecohealth_tradeoff2 = 0 if Q27==0
replace ecohealth_tradeoff2 = 0 if Q27<0
